<%@ page language="java" pageEncoding="UTF-8"%>
<%@page import="java.util.Calendar"%>
<%@page import="com.shsh.safemanage.action.ActionCreator"%>
<%@page import="com.shsh.safemanage.action.UserAction"%>
<%@page import="com.shsh.safemanage.model.Role"%>
<%@page import="com.shsh.safemanage.model.JobTitle"%>
<%@page import="com.shsh.safemanage.dao.DaoCreator"%>
<%@page import="com.shsh.safemanage.dao.TitlePostManageGroupDao"%>
<%@page import="com.shsh.safemanage.util.Constants"%>
<%@page import="com.shsh.safemanage.util.Util"%>
<%@page import="com.shsh.safemanage.model.User"%>
<%@page import="com.shsh.safemanage.model.PostCheck"%>

<%
{
TitlePostManageGroupDao titlePostManageGroupDao = DaoCreator.createTitlePostManageGroupDao();
User loginUser = (User) session.getAttribute(Constants.SESSION_USER);

%>
<div class="nav1"><a href="javascript:" class="h">菜单</a></div>
<%
if (loginUser == null) {
%>
<div class="nav2" style="display: block;">
	<div class="nav3" style="padding: 0; display: block;">
		<div class="nav4" style="padding: 0; display: block;">
			<div class="nav5" style="padding: 0 0 0 28px;">
				<a href="javascript:" onclick="loadPageSection('<%=request.getContextPath()%>/login.jsp', 'mainContentDiv')">登 录</a>
			</div>
			<div class="nav5" style="padding: 0 0 0 28px;">
				<a href="javascript:" onclick="loadPageSection('<%=request.getContextPath()%>/register1.jsp', 'mainContentDiv', {depart1ID:42, depart2ID:187, depart3ID:1814}, true)">注 册</a>
			</div>
		</div>
	</div>
</div>
<%
}
%>

<%
if (loginUser != null) {

	int[] currentDateInMenu = Util.getCurrentDate();
	int[] previousMonthInMenu = Util.getDate(Calendar.getInstance(), Calendar.MONTH, -1);

	UserAction theMenuUserAction = ActionCreator.createUserAction();
	Role theRole = theMenuUserAction.getUserRole(request);
%>
<div class="nav2" style="display: block;">
	<div class="nav3" style="padding: 0; display: block;">
		<%
		if ((theRole.getRoleType() & Constants.ROLE_TYPE_YIXIANYUANGONG) == 0) {
		%>
		<div class="nav4" style="padding: 0; display: block;">
			<div class="nav5" style="padding: 0 0 0 2px;">
				<a href="javascript:" onclick="loadPageSection('<%=request.getContextPath()%>/problems_tobe_processed.jsp', 'mainContentDiv', {}, true)">待办任务</a>
			</div>
		</div>
		<%
		}
		%>
	</div>
</div>
<div class="nav2">
	<a href="javascript:" class="nav2a">问题管理</a>
	<div class="nav3">
		<div class="nav5" style="padding: 0;">
			<a href="javascript:" onclick="loadPageSection('<%=request.getContextPath()%>/write_problem.jsp', 'mainContentDiv', {}, true)">问题填报</a>
		</div>
	</div>
	<div class="nav3">
		<div class="nav5" style="padding: 0;">
			<a href="javascript:" onclick="loadPageSection('<%=request.getContextPath()%>/problem_browse.jsp', 'mainContentDiv', {}, true)">浏 览</a>
		</div>
	</div>
</div>

<%
PostCheck[] postcheckArray = theMenuUserAction.getPostcheckMapping(request);
if(postcheckArray != null && postcheckArray.length > 0 || ((theRole.getRoleType() & Constants.ROLE_TYPE_YIXIANYUANGONG) == 0)) {
%>
<div class="nav2">
	<a href="javascript:" class="nav2a">岗检管理</a>
	<%	
	for (PostCheck postcheck: postcheckArray) {
	%>
	<div class="nav3">
		<a href="javascript:" class="nav3a"><%=postcheck.getCheckName()%></a>
		<div class="nav4" style="padding: 0;">
			<div class="nav5" style="padding: 0 0 0 20px;">
				<a href="javascript:" onclick="loadPageSection('<%=request.getContextPath()%>/postcheck/postcheck_standard_list.jsp', 'mainContentDiv', {postcheckID: <%=postcheck.getId() %>}, true)">填 报</a>
			</div>
		</div>
		<div class="nav4" style="padding: 0 0 0 20px;">
			<a href="javascript:" class="nav4a">浏 览</a>
			<div class="nav5" style="display: none">
				<a href="javascript:" onclick="loadPageSection('<%=request.getContextPath()%>/postcheck_browse.jsp', 'mainContentDiv', {postcheckID: <%=postcheck.getId() %>}, true);" style="padding:0 5px 0 15px;background:url('./images/nav2a.jpg') no-repeat;line-height:20px;">查出问题和考核汇总</a>
			</div>
			<div class="nav5" style="display: none">
				<a href="javascript:" onclick="loadPageSection('<%=request.getContextPath()%>/postcheck/report/postcheck_summary_report.jsp', 'mainContentDiv', {postcheckID: <%=postcheck.getId() %>, year: <%=currentDateInMenu[0]%>, month: <%=currentDateInMenu[1]%> }, true);" style="padding:0 5px 0 15px;background:url('./images/nav2a.jpg') no-repeat;line-height:20px;">岗检管理记录情况一览表</a>
			</div>
		</div>
	</div>
	<%
	}
	%>
	<div class="nav3">
		<a href="javascript:" class="nav3a">岗检汇总统计</a>
		<div class="nav4" style="padding: 0 0 0 20px;">
			<a href="javascript:" class="nav4a">填 报</a>
<% 
if((theRole.getRoleType() & (Constants.ROLE_TYPE_ZHUANGZHIZHANG | Constants.ROLE_TYPE_ZUYUAN 
		| Constants.ROLE_TYPE_ZUZHANG | Constants.ROLE_TYPE_ANQUANZONGJIAN | Constants.ROLE_TYPE_SHEBEIFUBUZHANG
		 | Constants.ROLE_TYPE_SHENGCHANFUBUZHANG  | Constants.ROLE_TYPE_BUZHANG))>0){
%>
			<div class="nav5" style="padding: 0 0 0 20px;display: none">
				<a href="javascript:" onclick="loadPageSection('<%=request.getContextPath()%>/postcheck/report/write_depart_month_check.jsp', 'mainContentDiv', {year: <%=previousMonthInMenu[0]%>, month: <%=previousMonthInMenu[1]%> }, true)">作业部填报岗检考核汇总表</a>
			</div>
<% 
}
%>
<%
if((theRole.getRoleType() & (Constants.ROLE_TYPE_KEYUAN | Constants.ROLE_TYPE_FUKEZHANG | Constants.ROLE_TYPE_KEZHANG
		| Constants.ROLE_TYPE_FUCHUZHANG | Constants.ROLE_TYPE_CHUZHANG))>0){

	if(loginUser.getDepartment1ID().equals(Constants.DEPARTMENT1_ID_QIYEGUANLICHU)) {
%>
			<div class="nav5" style="padding: 0 0 0 20px;display: none">
				<a href="javascript:" onclick="loadPageSection('<%=request.getContextPath()%>/postcheck/report/write_corp_month_sanwei.jsp', 'mainContentDiv', {year: <%=previousMonthInMenu[0]%>, month: <%=previousMonthInMenu[1]%> }, true)">职能处室填报三违现象问题</a>
			</div>
			<div class="nav5" style="padding: 0 0 0 20px;display: none">
				<a href="javascript:" onclick="loadPageSection('<%=request.getContextPath()%>/postcheck/report/write_month_quality.jsp', 'mainContentDiv', {year: <%=previousMonthInMenu[0]%>, month: <%=previousMonthInMenu[1]%> }, true)">企管处填报岗检质量评价表</a>
			</div>
<%
	} else {
		%>
		<div class="nav5" style="padding: 0 0 0 20px;display: none">
			<a href="javascript:" onclick="loadPageSection('<%=request.getContextPath()%>/postcheck/report/write_depart_month_sanwei.jsp', 'mainContentDiv', {year: <%=previousMonthInMenu[0]%>, month: <%=previousMonthInMenu[1]%> }, true)">职能处室填报三违现象问题</a>
		</div>
<%
	}
%>
<%
}
%>
		</div>
		<div class="nav4" style="padding: 0 0 0 20px;">
			<a href="javascript:" class="nav4a">浏 览</a>
			<div class="nav5" style="display: none">
				<a href="javascript:"  onclick="loadPageSection('<%=request.getContextPath()%>/postcheck/report/month_check_summary_report.jsp', 'mainContentDiv', {year: <%=currentDateInMenu[0]%>, month: <%=currentDateInMenu[1]%> }, true);" style="padding:0 5px 0 15px;background:url('./images/nav2a.jpg') no-repeat;line-height:20px;">公司岗检考核汇总表</a>
			</div>
			<div class="nav5" style="display: none">
				<a href="javascript:" onclick="loadPageSection('<%=request.getContextPath()%>/postcheck/report/read_chushi_month_quality.jsp', 'mainContentDiv', {year: <%=previousMonthInMenu[0]%>, month: <%=previousMonthInMenu[1]%> }, true);" style="padding:0 5px 0 15px;background:url('./images/nav2a.jpg') no-repeat;line-height:20px;">职能处室岗检质量评价表</a>
			</div>
			<div class="nav5" style="display: none">
				<a href="javascript:" onclick="loadPageSection('<%=request.getContextPath()%>/postcheck/report/read_shiyebu_month_quality.jsp', 'mainContentDiv', {year: <%=previousMonthInMenu[0]%>, month: <%=previousMonthInMenu[1]%> }, true);" style="padding:0 5px 0 15px;background:url('./images/nav2a.jpg') no-repeat;line-height:20px;">作业部岗检质量评价表</a>
			</div>
			<!-- 
			<div class="nav5" style="display: none">
				<a href="javascript:" onclick="loadPageSection('<%=request.getContextPath()%>/postcheck/report/depart_month_check_summary_report.jsp', 'mainContentDiv', {year: <%=currentDateInMenu[0]%>, month: <%=currentDateInMenu[1]%>, depart1ID: <%=loginUser.getDepartment1ID() %> }, true);" style="padding:0 5px 0 15px;background:url('./images/nav2a.jpg') no-repeat;line-height:20px;">作业部<%=currentDateInMenu[1]%>月岗检考核汇总表</a>
			</div>
			 -->
		</div>
	</div>
</div>
<%
}
%>

<%
if((theRole.getRoleType()&Constants.ROLE_TYPE_YIXIANYUANGONG)==0) {
%>

<div class="nav2">
	<a href="javascript:" class="nav2a">问题报告</a>
	<div class="nav3">
		<a href="javascript:" class="nav3a">未遂事件</a>
<%
	if(theRole.getRoleLevel() >= Constants.ROLE_LEVEL_KEJI) {
%>
		<div class="nav4" style="padding: 0">
			<div class="nav5" style="padding: 0 0 0 20px">
				<a href="javascript:" onclick="loadPageSection('<%=request.getContextPath()%>/defect/problem_browse.jsp', 'mainContentDiv', {init: true}, true)">填 报</a>
			</div>
		</div>
<%
	}
%>
		<div class="nav4" style="padding: 0">
			<div class="nav5" style="padding: 0 0 0 20px">
				<a href="javascript:" onclick="loadPageSection('<%=request.getContextPath()%>/defect/defect_browse.jsp', 'mainContentDiv', {}, true)">浏 览</a>
			</div>
		</div>
	</div>
	<div class="nav3">
		<a href="javascript:" class="nav3a">事苗</a>
<%
	if(theRole.getRoleLevel() >= Constants.ROLE_LEVEL_KEJI) {
%>
		<div class="nav4" style="padding: 0">
			<div class="nav5" style="padding: 0 0 0 20px">
				<a href="javascript:" onclick="loadPageSection('<%=request.getContextPath()%>/tendency/problem_browse.jsp', 'mainContentDiv', {init: true}, true)">填 报</a>
			</div>
		</div>
<%
	}
%>
		<div class="nav4" style="padding: 0">
			<div class="nav5" style="padding: 0 0 0 20px">
				<a href="javascript:" onclick="loadPageSection('<%=request.getContextPath()%>/tendency/tendency_browse.jsp', 'mainContentDiv', {}, true)">浏 览</a>
			</div>
		</div>
	</div>
	<div class="nav3">
			<a href="javascript:" class="nav3a">事故</a>
			<div class="nav4" style="padding: 0">
				<div class="nav5" style="padding: 0 0 0 20px">
					<a href="javascript:" onclick="loadPageSection('<%=request.getContextPath()%>/accident/application_table_depart.jsp', 'mainContentDiv', {}, true)">填 报</a>
				</div>
			</div>
			<div class="nav4" style="padding: 0">
				<div class="nav5" style="padding: 0 0 0 20px">
					<a href="javascript:" onclick="loadPageSection('<%=request.getContextPath()%>/accident/accident_browse.jsp', 'mainContentDiv', {}, true)">浏 览</a>
				</div>
			</div>
	</div>
	<div class="nav3">
		<a href="javascript:" class="nav3a">非计划停工</a>
<%
	if(theRole.getRoleLevel() >= Constants.ROLE_LEVEL_KEJI) {
%>
		<div class="nav4" style="padding: 0">
			<div class="nav5" style="padding: 0 0 0 20px">
				<a href="javascript:" onclick="loadPageSection('<%=request.getContextPath()%>/shutdown/problem_browse.jsp', 'mainContentDiv', {problemType: <%=Constants.PROBLEM_TYPE_NOTPLANED_SHUTDOWN %>, init: true}, true)">填 报</a>
			</div>
		</div>
<%
	}
%>
		<div class="nav4" style="padding: 0">
			<div class="nav5" style="padding: 0 0 0 20px">
				<a href="javascript:" onclick="loadPageSection('<%=request.getContextPath()%>/shutdown/shutdown_browse.jsp', 'mainContentDiv', {problemType: <%=Constants.PROBLEM_TYPE_NOTPLANED_SHUTDOWN %>}, true)">浏 览</a>
			</div>
		</div>
	</div>
	<div class="nav3">
		<a href="javascript:" class="nav3a">临时停工</a>
<%
	if(theRole.getRoleLevel() >= Constants.ROLE_LEVEL_KEJI) {
%>
		<div class="nav4" style="padding: 0">
			<div class="nav5" style="padding: 0 0 0 20px">
				<a href="javascript:" onclick="loadPageSection('<%=request.getContextPath()%>/shutdown/problem_browse.jsp', 'mainContentDiv', {problemType: <%=Constants.PROBLEM_TYPE_TEMP_SHUTDOWN %>, init: true}, true)">填 报</a>
			</div>
		</div>
<%
	}
%>
		<div class="nav4" style="padding: 0">
			<div class="nav5" style="padding: 0 0 0 20px">
				<a href="javascript:" onclick="loadPageSection('<%=request.getContextPath()%>/shutdown/shutdown_browse.jsp', 'mainContentDiv', {problemType: <%=Constants.PROBLEM_TYPE_TEMP_SHUTDOWN %>}, true)">浏 览</a>
			</div>
		</div>
	</div>
	<div class="nav3">
		<a href="javascript:" class="nav3a">其他报告</a>
<%
	if(theRole.getRoleLevel() >= Constants.ROLE_LEVEL_KEJI) {
%>
		<div class="nav4" style="padding: 0">
			<div class="nav5" style="padding: 0 0 0 20px">
				<a href="javascript:" onclick="loadPageSection('<%=request.getContextPath()%>/other/write_other.jsp', 'mainContentDiv', {init: true}, true)">填 报</a>
			</div>
		</div>
<%
	}
%>
		<div class="nav4" style="padding: 0">
			<div class="nav5" style="padding: 0 0 0 20px">
				<a href="javascript:" onclick="loadPageSection('<%=request.getContextPath()%>/other/other_browse.jsp', 'mainContentDiv', {}, true)">浏 览</a>
			</div>
		</div>
	</div>
</div>
<%
}
%>


<div class="nav2">
	<a href="javascript:" class="nav2a">综合管理</a> 
	<div class="nav3">
		<a href="javascript:" class="nav3a">薄弱环节汇总表</a>
<%
if ((theRole.getRoleType() & (Constants.ROLE_TYPE_YIXIANYUANGONG | Constants.ROLE_TYPE_ZONGJINGLI | Constants.ROLE_TYPE_ZONGSHI)) == 0) {
%>
		<div class="nav4" style="padding: 0">
			<div class="nav5" style="padding: 0 0 0 20px">
				<a href="javascript:" onclick="loadPageSection('<%=request.getContextPath()%>/weak/write_report.jsp', 'mainContentDiv', {}, true)">填 报</a>
			</div>
		</div>
<%
}
%>
		<div class="nav4" style="padding: 0">
			<div class="nav5" style="padding: 0 0 0 20px">
				<a href="javascript:" onclick="loadPageSection('<%=request.getContextPath()%>/weak/read_corp_report.jsp', 'mainContentDiv', {year: <%=previousMonthInMenu[0]%>}, true)">浏 览</a>
			</div>
		</div>
	</div>
<%
if ((theRole.getRoleType() & (Constants.ROLE_TYPE_BUZHANG | Constants.ROLE_TYPE_SHENGCHANFUBUZHANG | Constants.ROLE_TYPE_SHEBEIFUBUZHANG
		| Constants.ROLE_TYPE_ANQUANZONGJIAN | Constants.ROLE_TYPE_ZHUANGZHIZHANG)) > 0) {
%>
	<div class="nav3">
		<div class="nav5" style="padding: 0;">
			<a href="javascript:" 
				onclick="callJspProcess('<%=request.getContextPath()%>/remove_problemlist_date_process.jsp', {}); 
					loadPageSection('<%=request.getContextPath()%>/problems_tobe_processed_supervise.jsp', 'mainContentDiv', {}, true)">作业部问题整改监督</a>
		</div>
	</div>
<%
}
%>
</div>


<div class="nav2" style="display: block;">
	<div class="nav3" style="padding: 0; display: block;">
		<div class="nav4" style="padding: 0; display: block;">
			<div class="nav5" style="padding: 0 0 0 2px;">
				<a href="javascript:" onclick="loadPageSection('<%=request.getContextPath()%>/register1_1.jsp', 'mainContentDiv', {}, true, function(){ refreshUser1(); } )">个人信息设置</a>
			</div>
		</div>
	</div>
</div>
<%
}
%>

<script type="text/javascript">
$('.nav2a').click(function() {
	if ($(this).nextAll('.nav3').css('display') == 'none') {
		$(this).nextAll('.nav3').show();
	} else {
		$(this).nextAll('.nav3').hide();
	}
	
	adjustHeightNonAjax();
});

$('.nav3a').click(function() {
	if ($(this).nextAll('.nav4').css('display') == 'none') {
		$(this).nextAll('.nav4').show();
	} else {
		$(this).nextAll('.nav4').hide();
	}
	
	adjustHeightNonAjax();
});

$('.nav4a').click(function() {
	if ($(this).nextAll('.nav5').css('display') == 'none') {
		$(this).nextAll('.nav5').show();
	} else {
		$(this).nextAll('.nav5').hide();
	}
	
	adjustHeightNonAjax();
});
</script>
<%
}
%>